#include "missionsimulation.h"
#include "ui_missionsimulation.h"

#include <osgEarth/EarthManipulator>
#include <osgEarth/MapNode>
#include <osgEarth/TMS>
#include <osgViewer/Viewer>

MissionSimulation::MissionSimulation(QWidget* parent)
    : QWidget(parent)
    , ui(new Ui::MissionSimulation)
{
    ui->setupUi(this);

    osgEarth::initialize();

    auto imagery = new osgEarth::TMSImageLayer();
    imagery->setURL("https://readymap.org/readymap/tiles/1.0.0/7/");

    auto mapNode = new osgEarth::MapNode();
    mapNode->getMap()->addLayer(imagery);

    osgViewer::Viewer viewer;
    viewer.setSceneData(mapNode);
    viewer.setCameraManipulator(new osgEarth::EarthManipulator());

    viewer.run();
}

MissionSimulation::~MissionSimulation()
{
    delete ui;
}
